package exam5;

/**
 * @author HB
 * @version 1.0
 * @description
 * @date 2021/6/24
 */
import java.util.*;

public class Plate extends MyElement
{
    private ArrayList list=new ArrayList();

    public void add(MyElement element)
    {
        list.add(element);
    }

    public void delete(MyElement element)
    {
        list.remove(element);
    }

    @Override
    public void eat()
    {
        for(Object object:list)
        {
            ((MyElement)object).eat();
        }
    }
}
